/**
 * Copyright (C) 2011  E-Robot
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
 *
 * @brief Sonar.h
 *
 * @date 20 oct. 2010
 * @author Elias Capito
 * @version 0.1
 */

#ifndef SONAR_H_
#define SONAR_H_


#include "Vecteur.h"
#include "def.h"

#include <qvector2d.h>
#include <boost/unordered_map.hpp>
#include <libplayerc++/playerc++.h>
using namespace boost;


class Sonar
{
private:

	int m_index;
	QVector2D m_pos;
	double m_hyp;
	double m_angle;
	PositionEnum m_posType;
	double m_distance;
	boost::unordered_map<AlgoEnum,Vecteur> m_hash;
	SonarProximityEnum m_prox;


public:
	Sonar(int _index, player_pose3d_t _pos,PositionEnum _posType = AnyPosition);
	virtual ~Sonar();
    double distance() const;
    int index() const;
    PositionEnum pos() const;
    SonarProximityEnum prox() const;
    void setDistance(double m_distance);
    void setIndex(int m_index);
    void setPosType(PositionEnum m_pos);
    void defineVecteurToAlgo(AlgoEnum _algo, Vecteur _vec);
    void deleteVecteurToAlgo(AlgoEnum _algo);
    Vecteur getVecteurToAlgo(AlgoEnum _algo);

    double distancRobotCenterToCapteur();
    QVector2D vectorRobotCenterToCapteur();
    double angle();
};

#endif /* SONAR_H_ */
